package com.hfb.mashibing.alip8.designpattern._11flyweight;

public class TestString {
    public static void main(String[] args) {
        String s1 = "abc";
        String s2 = "abc";
        String s3 = new String("abc");
        String s4 = new String("abc");

        System.out.printf("s1 == s2:%s\n", s1 == s2);
        System.out.printf("s1 == s3:%s\n", s1 == s3);
        System.out.printf("s3 == s4:%s\n", s3 == s4);
        System.out.printf("s3.intern() == s1:%s\n", s3.intern() == s1);
        System.out.printf("s3.intern() == s4.intern():%s\n", s3.intern() == s4.intern());
    }
}
